package com.win.cn;

import com.win.cn.core.pane.ActivityPane;
import com.win.cn.core.pane.DetailPane;
import com.win.cn.core.pane.ResourcesPane;
import com.win.cn.core.pane.TopPane;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;

/**
 * 程序入口
 * @author wangzh
 * 2018年6月7日 上午9:22:40
 */
public class WinStart extends Application{
	
	/**
	 * 总排版
	 */
	public static BorderPane borderPane;
	
	/**
	 * 资源pane
	 */
	public static AnchorPane resourcesPane;
	
	
	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage primaryStage) throws Exception {

		
		//创建布局pane
		borderPane=new BorderPane();
		borderPane.setTop(new TopPane().createTopMenu());
		borderPane.setLeft(createLeft());
		borderPane.setCenter(new DetailPane().createTimePane());
		
		//pane放入Scen中
		Scene scene=new Scene(borderPane,900,600);
		
		//设置stage的scen,显示自己的stage
		primaryStage.setScene(scene);
		primaryStage.setTitle("Hello");
		primaryStage.show();
		
	}
	
	public FlowPane createLeft(){
		FlowPane left=new FlowPane();
		resourcesPane=new ResourcesPane().createResourcesPane();
		//添加活动页面和资源页面
		left.getChildren().addAll(new ActivityPane().createActivityPane(),resourcesPane);	
//		//添加右键菜单
//    	left.setContextMenu(new GlobalMenu());
		left.setMaxWidth(230);
		
//		left.setStyle("-fx-border-color: yellow;-fx-border-width: inherit;");
    	
		return left;
	}

}
